package com.enfi.api.modules.bz.service;



import com.enfi.api.modules.bz.domain.db.ColumnSearchVo;
import com.enfi.api.modules.bz.domain.db.ForeignKeySearchVo;
import com.enfi.api.modules.bz.domain.db.PrimarySearchVo;
import com.enfi.api.modules.bz.domain.db.TableSearchVo;
import com.enfi.api.modules.db.entity.Database;

import java.sql.Connection;
import java.util.List;

/**
 * @author wind
 * @date 2020/3/12
 */
public interface DataSourceService {

    public List getTables(Database ds, TableSearchVo tableSearchVo) throws Exception;

    public List getColumns(Database ds, ColumnSearchVo columnSearchVo) throws Exception;

    public List getPrimaryKeys(Database ds, PrimarySearchVo primarySearchVo) throws Exception;

    public List getForeignKeys(Database ds, ForeignKeySearchVo foreignKeySearchVo) throws Exception;

    public List execute(Database ds, String sql) throws Exception;

    public List execute1(Database ds, String sql) throws Exception;

    public Connection getConnection(Database ds) throws Exception;

    public Connection getNativeConnection(Database ds) throws Exception;

    public String getUrl(Database ds) throws Exception;

    public boolean test(Database ds) throws Exception;

    public boolean testNative(Database ds) throws Exception;

    public void valid(Database ds) throws Exception;
}
